﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using wt.wine.Application.Common.Interfaces;
using wt.wine.Domain.DTOModel;
using wt.wine.Infrastructure.InternalHttp;

namespace wt.wine.Infrastructure.Persistence.Repository
{
    public class GetDevocetableStatusRepository : IGetDevocetableStatusRepository
    {
        private readonly IInternalHttpService _internalhttpservice;

        public GetDevocetableStatusRepository(IInternalHttpService internalhttpservice)
        {
            _internalhttpservice = internalhttpservice;
        }

        public async Task<Dictionary<string, Device>> GetDeviceStates(CancellationToken cancellationtoken)
        {
            var model= await _internalhttpservice.PostJsonAsync<GetAllStatusDeviceDTO>(Domain.Enums.ApiServiceType.JiuJi, "api/App/GetAllIds", new object { }, cancellationtoken);
            return model?.list;
        }
    }
}
